import 'package:flutter_test/flutter_test.dart';
import 'package:yd_eval/yd_eval.dart';
import 'package:yd_eval/yd_eval_platform_interface.dart';
import 'package:yd_eval/yd_eval_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockYdEvalPlatform
    with MockPlatformInterfaceMixin
    implements YdEvalPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final YdEvalPlatform initialPlatform = YdEvalPlatform.instance;

  test('$MethodChannelYdEval is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelYdEval>());
  });

  test('getPlatformVersion', () async {
    YdEval ydEvalPlugin = YdEval();
    MockYdEvalPlatform fakePlatform = MockYdEvalPlatform();
    YdEvalPlatform.instance = fakePlatform;

    expect(await ydEvalPlugin.getPlatformVersion(), '42');
  });
}
